import request from '@/utils/request'

// 查询用户预约单列表
export function listData(query) {
  return request({
    url: '/data/user/productSend/record/',
    method: 'get',
    params: query
  })
}

// 查询用户预约单详细
export function getDetail(id) {
  return request({
    url: '/data/user/productSend/recordDetail/' + id,
    method: 'get'
  })
}

// 查询用户预约单日志
export function getLog(query) {
  return request({
    url: '/data/user/productSend/recordLog/',
    method: 'get',
    params: query
  })
}

// 下单
export function createData(data) {
  return request({
    url: '/data/user/productSend/record/',
    method: 'post',
    data: data
  })
}

// 仓管分配订单
export function assignOrder(data) {
  return request({
    url: '/data/user/productSend/record/allocation',
    method: 'put',
    params: data
  })
}
//更换配送员
export function changeAssignOrder(data) {
  return request({
    url: '/data/user/productSend/record/change',
    method: 'post',
    params: data
  })
}


// 仓管追加订单
export function addOrder(data) {
  return request({
    url: '/data/user/productSend/record/allocation/append',
    method: 'put',
    params: data
  })
}


// 配送员确认送达
export function confirmDelivery(data) {
  return request({
    url: '/data/user/productSend/record/confirm/delivery',
    method: 'post',
    data: data
  })
}


// 配送员确认配送
export function confirmSend(data) {
  return request({
    url: '/data/user/productSend/record/confirm/send',
    method: 'put',
    params: data
  })
}

// 取消配送
export function cancelSend(data) {
  return request({
    url: '/data/user/productSend/record/cancel',
    method: 'post',
    params:data
  })
}

// 转库
export function changeSend(data) {
  return request({
    url: '/data/user/productSend/record/transform',
    method: 'post',
    params: data
  })
}


// //配送订单明细列表
// export function particularsList(query) {
//   return request({
//     url: '/data/user/productSend/record/particulars',
//     method: 'get',
//     params: query
//   })
// }
// //配送订单明细详情
// export function particularDetail(id) {
//   return request({
//     url: '/data/user/productSend/recordDetail/particulars/'+ id,
//     method: 'get'
//   })
// }
//配送订单明细汇总
export function particularSum(query) {
  return request({
    url: '/data/user/productSend/recordDetail/all/particulars',
    method: 'get',
    params: query
  })
}
